<template>
    <el-container class="richtext-select panel-block">
      <el-main>
        <div class="usersList" v-if="form.user?.length">
            <div class="usersList-title sa-flex">
                <div class="userinfo">用户</div>
                <div class="time">到期时间</div>
                <div class="income">收益</div>
            </div>
            <div class="usersList-content sa-flex" v-for="(item, index) in form.user" :key="index">
                <div class="userinfo">
                    <sa-user-profile :user="item" :id="item.id"/>
                </div>
                <div class="time">
                    {{formatTime(item?.expiration_time)||'请选择'}}
                </div>
                <div class="income">{{item?.devIncome? `${item.devIncome}%`:'-'  }}</div>
            </div>
        </div>
      
      </el-main>
    
    </el-container>
  </template>
  
  <script setup>
  import {onMounted, reactive, ref} from 'vue';
  import {cloneDeep} from "lodash";
  import MemberList from './memberList.vue';
 
  const props = defineProps(['modal']);
  const emit = defineEmits(['modalCallBack']);



  // 列表
  const table = reactive({
    data: [],
  });
  const loading = ref(true);
  // 获取
  async function getData() {
    loading.value = true;
   
    const {error, data} = await api.newApi.storeList({
     
    })
    if (error == 0) {
      table.data = data.data;
      
    }
    loading.value = false;
  }

  function look(data){
    useModal(MemberList, 
        {
          title: '查看团员列表',
          id,
        }
      );
  }

  function modalCallBack(e) {
    emit('modalCallBack', {event: 'confirm', data: cloneDeep(e)});
  }
  
  onMounted(() => {
    getData();
  });
  </script>
  <style lang="scss" scoped>
  </style>
  